#/**************************************************************
#Copyright (c) 2010, Payton Byrd
#All rights reserved.
#
#Redistribution and use in source and binary forms, with or 
#without modification, are permitted provided that the following 
#conditions are met:
#
#* Redistributions of source code must retain the above 
#  copyright notice, this list of conditions and the following 
#  disclaimer.
#
#* Redistributions in binary form must reproduce the above 
#  copyright notice, this list of conditions and the following 
#  disclaimer in the documentation and/or other materials 
#  provided with the distribution.
#
#* Neither the name of A2-Command Team nor the names of its 
#  contributors may be used to endorse or promote products 
#  derived from this software without specific prior written 
#  permission.
#
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
#CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
#NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
#HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
#OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
#EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#***************************************************************/

# Configuration for ProDOS 8 system programs (without the header)

SYMBOLS {
    __HIMEM__:       type = weak, value = $BB00; # Presumed RAM end
    __LCADDR__:    type = weak, value = $D400; # Behind quit code
    __LCSIZE__:    type = weak, value = $0C00; # Rest of bank two
    __STACKSIZE__: type = weak, value = $0200; # 1k stack
    __OVERLAYSIZE__: type = weak, value = $2900; # 8k overlay
    __LOADADDR__:    type = weak, value = __STARTUP_RUN__;
    __LOADSIZE__:    type = weak, value = __ZPSAVE_RUN__ - __STARTUP_RUN__ +
                                          __MOVE_LAST__  - __MOVE_START__;}
MEMORY {
    ZP:              define = yes, start = $0080,      size = $001A;
    RAM:    file = %O,               start = $2000, size = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__ - $2000;
    MOVE:   file = %O, define = yes, start = $0000,                size = $FFFF;
    LC:              define = yes, start = __LCADDR__, size = __LCSIZE__;
    OVL1:   file = "%O.TV",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL2:   file = "%O.DC",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL3:   file = "%O.DI",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL4:   file = "%O.FO",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL5:   file = "%O.HE",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL6:   file = "%O.BV",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL7:   file = "%O.FM",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
    OVL8:   file = "%O.ID",           start = __HIMEM__ - __STACKSIZE__ - __OVERLAYSIZE__,                   size = __OVERLAYSIZE__;
}
SEGMENTS {
    ZEROPAGE: load = ZP,              type = zp;
    STARTUP:  load = RAM,             type = ro,  define   = yes;
    LOWCODE:  load = RAM,             type = ro;
    CODE:     load = RAM,             type = ro;
    RODATA:   load = RAM,             type = ro;
    DATA:     load = RAM,             type = rw;
    ZPSAVE:   load = RAM,             type = bss, define   = yes;
    BSS:      load = RAM,             type = bss, define   = yes;
    INIT:     load = MOVE, run = RAM, type = ro,  define   = yes;
    LC:       load = MOVE, run = LC,  type = ro,  optional = yes;
    TEXTVIEW: load = OVL1,            type = ro,  define = yes, optional = yes;
    TVDATA:   load = OVL1,            type = rw,  define = yes, optional = yes;
    TVBSS:    load = OVL1,            type = bss, define = yes, optional = yes;
    DISKCOPY: load = OVL2,            type = ro,  define = yes, optional = yes;
    DCDATA:   load = OVL2,            type = rw,  define = yes, optional = yes;
    DISKIMGS: load = OVL3,            type = ro,  define = yes, optional = yes;
    DIDATA:   load = OVL3,            type = rw,  define = yes, optional = yes;
    FILEOPS:  load = OVL4,            type = ro,  define = yes, optional = yes;
    FODATA:   load = OVL4,            type = rw,  define = yes, optional = yes;
    FOBSS:    load = OVL4,            type = bss, define = yes, optional = yes;
    HEXEDIT:  load = OVL5,            type = ro,  define = yes, optional = yes;
    HEDATA:   load = OVL5,            type = rw,  define = yes, optional = yes;
    BASICVW:  load = OVL6,            type = ro,  define = yes, optional = yes;
    BVDATA:   load = OVL6,            type = rw,  define = yes, optional = yes;
    BVBSS:    load = OVL6,            type = bss, define = yes, optional = yes;
	FORMAT:   load = OVL7,            type = rw,  define = yes, optional = yes;
	FMDATA:   load = OVL7,            type = rw,  define = yes, optional = yes;
}
FEATURES {
    CONDES: type    = constructor,
            label   = __CONSTRUCTOR_TABLE__,
            count   = __CONSTRUCTOR_COUNT__,
            segment = INIT;
    CONDES: type    = destructor,
            label   = __DESTRUCTOR_TABLE__,
            count   = __DESTRUCTOR_COUNT__,
            segment = RODATA;
    CONDES: type    = interruptor,
            label   = __INTERRUPTOR_TABLE__,
            count   = __INTERRUPTOR_COUNT__,
            segment = RODATA,
            import  = __CALLIRQ__;
}
